
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Rectangle.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Rectangle)
{
	TEST(should be able to calc the perimeter:perimeter=10 when width=2,height=3)
	{
		Rectangle rect(2,3);
		ASSERT_EQ(10, rect.getPerimeter());
	}

	TEST(should be able to calc the area:area=6 when width=2,height=3)
	{
		Rectangle rect(2,3);
		ASSERT_EQ(6, rect.getArea());
	}
       
        TEST(should be able to change width and calc perimeter correctly.)
        {
                Rectangle rect(2,3);
                rect.setWidth(5);
                ASSERT_EQ(16, rect.getPerimeter());
        }
       
        TEST(should be able to change width and calc area correctly.)
        {
                Rectangle rect(2,3);
                rect.setWidth(5);
                ASSERT_EQ(15, rect.getArea());
        }      
       
        TEST(should be able to change height and calc perimeter correctly.)
        {
                Rectangle rect(2,3);
                rect.setHeight(5);
                ASSERT_EQ(14, rect.getPerimeter());
        }
       
        TEST(should be able to change height and calc area correctly.)
        {
                Rectangle rect(2,3);
                rect.setHeight(5);
                ASSERT_EQ(10, rect.getArea());
        } 
};


